矩形覆盖 Posted on 2019-08-12 | In 剑指offer | | reads times 矩形覆盖题目描述 我们可以用21的小矩形横着或者竖着去覆盖更大的矩形。请问用n个21的小矩形无重叠地覆盖一个2*n的大矩形,总共有多少种方法? 找规律发现其原理和斐波那契数列相符 12345678910111213141516function rectCover(number){ // write code here var g=1; var f=2; if(number==0){ return 0; } else { while(--number){ f+=g; g=f-g; } return g; }} Post author: GoldMiner Xun Post link: https://goldminerxun.github.io/2019/08/12/%E5%89%91%E6%8C%87offer%20JavaScript%E7%89%88%20(10)/ Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.